﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ajax_test.aspx.cs" Inherits="Webtest_view.ajax_test" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    <!--main things to have ajax in the page -->
    <br />
    <br />
    <br />
    <br />
    <asp:ScriptManager ID="MainScriptManager" runat="server" EnableHistory="true" EnablePartialRendering="true" />   
        <asp:UpdatePanel ID="HelloWorld" runat="server">
        
        <Triggers>
            <asp:AsyncPostBackTrigger controlid="Button1" eventname="Click" />
        </Triggers>

            <ContentTemplate>
           
            <asp:Label ID="Label1" runat="server" Text="Default One"></asp:Label>            
                <br />
                <br />
            <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" /> 
                     
                <br />
                <br />
                <asp:Label ID="Label2" runat="server" Text="Default Two "></asp:Label>
                <br />
                <asp:Button ID="Button2" runat="server" Text="Button" />
                <br />
                     
            </ContentTemplate>
        </asp:UpdatePanel>
        
    
    </div>
   <!-- add progress handler -->
    <br />
    <br />
    
    <br />
    <div>       
        <asp:UpdateProgress runat="server" id="PageUpdateProgress">
            <ProgressTemplate>
                Loading...
            </ProgressTemplate>
        </asp:UpdateProgress>
        <asp:UpdatePanel runat="server" id="Panel">
            <ContentTemplate>
                <asp:Button runat="server" id="UpdateButton" onclick="UpdateButton_Click" text="Update" />
            </ContentTemplate>
        </asp:UpdatePanel>
   
    </div>
       <!-- Update On timer -->
       
       <br />
       <br />
       <br />
    <div>
     <asp:Timer runat="server" id="UpdateTimer" interval="5000" ontick="UpdateTimer_Tick" />
        <asp:UpdatePanel runat="server" id="TimedPanel" updatemode="Conditional">
            <Triggers>
                <asp:AsyncPostBackTrigger controlid="UpdateTimer" eventname="Tick" />
            </Triggers>
            <ContentTemplate>
                <asp:Label runat="server" id="DateStampLabel" Text="Auto Updating with Timer " />
            </ContentTemplate>
        </asp:UpdatePanel>
    
    </div>
     </form>
    
    
</body>
</html>
